<div class="modal-message">
    <div class="ui-modal-address">
        <ul class="ui-list ui-address-list">
        [#list receiverList as receiver]
            <li class="ui-list-item ui-list-item-bfc ui-border-b J_address_list" data-consignee="${receiver.consignee}" data-phone="${receiver.phone}"
                data-address_id="${receiver.id}" data-area_id="${receiver.area.id}" data-address="${receiver.address}"  data-area_name="${receiver.areaName}" data-cod="0" data-transport_day="1" data-dismiss="closeModal">
                <div class="ui-list-item-left">
                    <div class="ui-radio  active ">
                        <i class="iconfont iconfont-radio"></i>
                    </div>
                </div>
                <div class="ui-list-item-info">
                    <h4><span class="username">${receiver.consignee}</span>
                        <span class="cellphone">${receiver.phone}</span>
                    </h4>
                    <p class="address">${receiver.areaName}${receiver.address}</p>
                </div>
                <div class="manage-address">
                    <a href="/member/receiver/edit?redirectUrl=/shop/cart/checkout&id=${receiver.id}" class="ui-button ui-button-border ui-button-border-gray ui-button-border-small" mars_sead="checkout_edit_address_radio">修改</a>
                    <a href="javascript:;" class="ui-button ui-button-border ui-button-border-gray ui-button-border-small J_address_del"
                       data-address_id="86052241" mars_sead="checkout_del_address_radio">删除</a>
                </div>
            </li>
        [/#list]
        </ul>
        <div class="ui-list ui-border-b">
            <div class="ui-list-item arrow-right">
                <a class="add-address J_address_add" href="/member/receiver/add?redirectUrl=/shop/cart/checkout" mars_sead="checkout_add_address_radio">添加收货地址</a>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    $(".J_address_list .ui-radio").click(function(){
        var consignee=$(this).closest(".J_address_list").attr("data-consignee");
        var phone=$(this).closest(".J_address_list").attr("data-phone");
        var receiverId=$(this).closest(".J_address_list").attr("data-address_id");
        var areaId=$(this).closest(".J_address_list").attr("data-area_id");
        var address=$(this).closest(".J_address_list").attr("data-address");
        var areaName=$(this).closest(".J_address_list").attr("data-area_name");
        var $cartAddress=$("#cart-address");
        $cartAddress.attr("data-address_id",receiverId);
        $cartAddress.find(".username").html(consignee);
        $cartAddress.find(".cellphone").html(phone);
        $cartAddress.find(".address").html(areaName+address);
        $("input[name='address_id']").val(receiverId);
    });
</script>